﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.Paint.DefinePaintBrush.CCoCDefineBrushCmdEnabler
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.ObjectModel;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.Paint.DefinePaintBrush;

internal class CCoCDefineBrushCmdEnabler : ITxCommandEnabler
{
  public bool Enable
  {
    get
    {
      bool flag = TxApplication.ActiveDocument.SimulationPlayer.IsSimulationRunning();
      return TxApplication.ActiveDocument.PlatformGlobalServicesProvider.IsDataLoaded() && this.ShouldEnable() && !flag;
    }
  }

  private bool ShouldEnable()
  {
    bool flag = false;
    TxSelection activeSelection = TxApplication.ActiveSelection;
    if (activeSelection.Count == 1 && TxRobot.op_Inequality(((Collection<ITxObject>) activeSelection.GetItems())[0] as TxRobot, (ITxObject) null))
      flag = true;
    return flag;
  }
}
